class BarFeed < ActiveRecord::Base
  belongs_to :bar
  belongs_to :user
  
  validates_presence_of :user_id, :bar_id, :action
  
  # Possible Actions are:
  # * 1 = Anstossen
  # * 2 = Runde ausgeben
  # * 3 = Neuer Stammgast
  # * 4 = Informationen geaendert
  # * 5 = Neues Bild
  # * 6 = Neues Video
  # * 7 = Neuer Mitarbeiter
  # * 8 = Neuer Besitzer
  # * 9 = Heute geht ... hin
  # * 10 = ... Hat die Stammbar verlassen
  def self.add_action(bar_id, user_id, action_id)
    feed_item = BarFeed.new
    feed_item.bar_id = bar_id.to_i
    feed_item.user_id = user_id.to_i
    feed_item.action = action_id.to_i
    feed_item.save!
  end
end
